﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using com.huigo.Framework.ServiceUtils;

namespace com.huigo.B2B.Web.center.invoice
{
    public partial class ApplyInvoice : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        /// <summary>
        /// 保险产品
        /// </summary>
        /// <returns></returns>
        public string PolicyName()
        {
            string content = string.Empty;
            List<RequestFuncParams> list = new List<RequestFuncParams>();
            list.Add(new RequestFuncParams("custFid", CustId.ToString()));
            BaseService service = new BaseService();
            ParserXml parser = service.RequestEntryService(Dict.ERequestFunc.GET_ORDER_PRODUCT_NAME, list);
            if (parser != null && parser.RowsCount > 0)
            {
                for (int i = 0; i < parser.RowsCount; i++)
                {
                    content += "<option value=\"" + parser["OrderProductFid", i] + "\">" + parser["ProductName", i] + "</option>";
                }
            }
            return content;
        }
        /// <summary>
        /// 查询省份
        /// </summary>
        /// <returns></returns>
        public string Province()
        {
            string content = "<option value=\"0\"></option>";
            List<RequestFuncParams> list = new List<RequestFuncParams>();
            BaseService service = new BaseService();
            ParserXml parser = service.RequestEntryService(Dict.ERequestFunc.GET_PROVINCE_LIST, list);
            if (parser != null && parser.RowsCount > 0)
            {
                for (int i = 0; i < parser.RowsCount; i++)
                {
                    content += "<option value=\"" + parser["ID", i] + "|" + parser["Postage", i] + "|" + parser["Name", i] + "\">" + parser["Name", i] + "</option>";
                }
            }
            return content;
        }
        /// <summary>
        /// 配送方式
        /// </summary>
        /// <returns></returns>
        public string Shipping()
        {
            string content = string.Empty;
            List<DropList> statusDropList = Tools.DictToDropList(Dict.DictInvoiceDeliverType);
            if (statusDropList != null)
            {
                for (int i = 0; i < statusDropList.Count; i++)
                {
                    if (!string.IsNullOrEmpty(statusDropList[i].id))
                    {
                        content += "<option value=\"" + statusDropList[i].id + "\">" + statusDropList[i].value + "</option>";
                    }
                }
            }
            return content;
        }
    }
}
